fn main() {
    println!("Hello, world!");
    //计算一个长方形面积

    let a = Rectangle{
        width:50,
        height:30,
    };
    let area = area(&a);
    println!("{}",area);

    println!("{:#?}",a);
}


#[derive(Debug)]
struct Rectangle{
    width:u32,
    height:u32,
}

fn area(rect:&Rectangle)->u32 {
    rect.width*rect.height
}